{extend name="admin@index_layout"/}
{block name="main"}
<div class="layui-card">
    <div class="layui-card-header">采集管理</div>
    <div class="layui-card-body">
        <div class="layui-form">
            <table class="layui-hide" id="dataTable" lay-filter="dataTable"></table>
        </div>
    </div>
</div>
<script type="text/html" id="toolbarDemo">
    <div class="layui-btn-container">
      <a class="layui-btn layui-btn-sm" href='{:url("add")}'>添加采集任务</a>
      <a class="layui-btn layui-btn-sm layui-btn-danger confirm layui-batch-all" data-href='{:url("delete")}'>批量删除</a>
    </div>
</script>

<script type="text/html" id="caijiTool">
    <a class="layui-btn layui-btn-xs layui-btn-normal layui-iframe" href="{:url('col_url_list')}?id={{ d.id }}" lay-data="{width:'800px',height:'400px',title:'正在采集'}">采集内容</a>
    <a class="layui-btn layui-btn-xs layui-btn-normal" href="{:url('publist')}?id={{ d.id }}&type=1">内容发布</a>
</script>
<script type="text/html" id="barTool">
    <!--<a class="layui-btn layui-btn-xs layui-btn-normal layui-iframe" href="" >测试</a>-->
    <a href='{:url("edit")}?id={{ d.id }}' class="layui-btn layui-btn-xs">编辑</a>
    <a href='{:url("delete")}?ids={{ d.id }}' class="layui-btn layui-btn-danger layui-btn-xs layui-tr-del">删除</a>
</script>
{/block}
{block name="script"}
<script>
layui.use('table', function() {
    var table = layui.table,
        $ = layui.$,
        form = layui.form;
    table.render({
        elem: '#dataTable',
        toolbar: '#toolbarDemo',
        url: '{:url("index")}',
        cols: [
            [
                { type: 'checkbox', fixed: 'left' },
                { field: 'name', title: '名称' },
                { field: 'lastdate', width: 180, title: '最后采集时间', templet: '<div>{{#  if(d.lastdate){ }} {{d.lastdate}} {{#  } else { }} / {{#  } }}</div>' },
                { width: 200,align:"center", title: '内容操作',  templet: '#caijiTool'},
                { fixed: 'right', width: 180, title: '操作', toolbar: '#barTool' }
            ]
        ],
        page: {}
    });
});
</script>
{/block}